/* Tool Page Common Styles */

/* Hide navbar and footer on tool pages */
.navbar, .footer {
    display: none !important;
}

/* Back Button Style */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--card-bg);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid var(--border-color);
}

.back-button:hover {
    transform: translateY(-2px);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Theme Toggle Button on Tool Pages */
.tool-theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--card-bg);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-color);
}

.tool-theme-toggle:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tool-page {
    min-height: 100vh;
    padding: 100px 0 60px;
}

.tool-header {
    text-align: center;
    margin-bottom: 50px;
}

.tool-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-color);
}

.tool-header .tool-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

.tool-main {
    max-width: 900px;
    margin: 0 auto;
}

/* Description Section */
.tool-description {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 40px;
    border-left: 4px solid var(--primary-color);
}

.tool-description h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.tool-description p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
}

.tool-features {
    list-style: none;
    padding: 0;
}

.tool-features li {
    padding: 12px 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.tool-features li:last-child {
    border-bottom: none;
}

.tool-features li::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--success-color), #20c997);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Upload Section */
.upload-section {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 15px;
    padding: 60px 40px;
    text-align: center;
    background: var(--bg-color);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(0, 123, 255, 0.05);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 25px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.upload-area h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-size: 1rem;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 35px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
}

.file-input {
    display: none;
}

.file-info {
    margin-top: 20px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 10px;
    display: none;
}

.file-info.active {
    display: block;
}

.file-info-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-icon {
    font-size: 2rem;
    color: var(--success-color);
}

.file-details h4 {
    color: var(--text-color);
    margin-bottom: 5px;
}

.file-details p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* Format Selection */
.format-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    display: none;
}

.format-section.active {
    display: block;
}

.format-section h3 {
    margin-bottom: 25px;
    color: var(--text-color);
    font-size: 1.3rem;
}

.format-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
    max-width: 100%;
}

@media (max-width: 768px) {
    .format-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .format-grid {
        grid-template-columns: 1fr;
    }
}

.format-option {
    padding: 20px 15px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 600;
    color: var(--text-secondary);
}

.format-option:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.format-option.selected {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-color: transparent;
    transform: scale(1.05);
}

.format-option i {
    display: block;
    font-size: 1.8rem;
    margin-bottom: 8px;
}

/* Convert Button */
.convert-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--success-color), #20c997);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.convert-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
}

.convert-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Progress Section */
.progress-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    display: none;
}

.progress-section.active {
    display: block;
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: var(--bg-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
    position: relative;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.progress-text {
    text-align: center;
    color: var(--text-color);
    font-weight: 600;
    font-size: 1rem;
}

/* Preview Section */
.preview-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    display: none;
    border: 2px solid var(--border-color);
}

.preview-section.active {
    display: block;
    animation: slideUp 0.5s ease;
}

.preview-section h3 {
    color: var(--text-color);
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-container {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.preview-text {
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-color);
    line-height: 1.6;
    text-align: left;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.preview-table th {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.preview-table td {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.preview-table tr:nth-child(even) {
    background: var(--bg-color);
}

.preview-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.preview-image {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-slide {
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.preview-slide-header {
    background: var(--primary-color);
    color: white;
    padding: 10px 15px;
    font-weight: 600;
}

.preview-slide-content {
    padding: 10px;
}

/* Result Section */
.result-section {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    display: none;
}

.result-section.active {
    display: block;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-icon {
    font-size: 4rem;
    color: var(--success-color);
    margin-bottom: 20px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.result-section h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.result-section p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 35px;
    background: linear-gradient(135deg, var(--success-color), #20c997);
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    margin: 0 10px;
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
}

.new-conversion-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 35px;
    background: var(--bg-color);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 10px;
}

.new-conversion-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* Tags Section */
.tool-tags {
    margin-top: 50px;
    padding: 30px;
    background: var(--card-bg);
    border-radius: 15px;
}

.tool-tags h3 {
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tag {
    padding: 10px 18px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: default;
}

.tag:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

/* Back Button */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.back-link:hover {
    gap: 12px;
}

.back-link i {
    transition: transform 0.3s ease;
}

.back-link:hover i {
    transform: translateX(-5px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-page {
        padding: 80px 0 40px;
    }

    .tool-header h1 {
        font-size: 2rem;
    }

    .tool-header .tool-subtitle {
        font-size: 1rem;
    }

    .upload-section,
    .format-section,
    .progress-section,
    .result-section {
        padding: 25px 20px;
    }

    .upload-area {
        padding: 40px 25px;
    }

    .format-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .format-option {
        padding: 15px 10px;
    }

    .download-btn,
    .new-conversion-btn {
        width: 100%;
        margin: 10px 0;
        justify-content: center;
    }
}

/* Stylish Notification Popup */
.notification-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 400px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: flex-start;
    gap: 15px;
    z-index: 10000;
    animation: slideIn 0.4s ease-out;
    border-left: 4px solid var(--primary-color);
}

.notification-popup.success {
    border-left-color: var(--success-color);
}

.notification-popup.error {
    border-left-color: #e74c3c;
}

.notification-popup.warning {
    border-left-color: #f39c12;
}

.notification-popup.info {
    border-left-color: var(--primary-color);
}

.notification-popup-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-popup.success .notification-popup-icon {
    color: var(--success-color);
}

.notification-popup.error .notification-popup-icon {
    color: #e74c3c;
}

.notification-popup.warning .notification-popup-icon {
    color: #f39c12;
}

.notification-popup.info .notification-popup-icon {
    color: var(--primary-color);
}

.notification-popup-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.notification-popup-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
    font-size: 0.95rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.notification-popup-message {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 200px;
    overflow-y: auto;
}

.notification-popup-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.notification-popup-close:hover {
    background: var(--border-color);
    color: var(--text-color);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.notification-popup.hiding {
    animation: slideOut 0.3s ease-in forwards;
}

@media (max-width: 768px) {
    .notification-popup {
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        min-width: auto;
    }
}

/* Custom Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}
/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-color);
}
